package com.itheima.exerciseTest.test20_29;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class Test26 {
    public static void main(String[] args) {
        Collection<String> list = new ArrayList<>();
        list.add("aaa");
        list.add("ccc");
        list.add("ccc");
        list.add("bbb");

        Iterator<String> it = list.iterator();
        while(it.hasNext()){
            if(it.next().equals("ccc")){
                it.remove();
            }
        }
        System.out.println(list);
    }
}
